package edu.mit.compilers.lowercode;

import edu.mit.compilers.ir.type.IRBasicType;

import java.util.HashMap;

public class MethodInfo {
    private String methodName;
    private IRBasicType returnType;

    // local field and temporary field
    private HashMap<String, FieldInfo> fieldsInfo = new HashMap<>();

    public MethodInfo(String methodName, IRBasicType returnType) {
        this.methodName = methodName;
        this.returnType = returnType;
    }

    public String getMethodName() {
        return methodName;
    }

    public IRBasicType getReturnType() {
        return returnType;
    }

    public void addFieldInfo(FieldInfo fieldInfo) { fieldsInfo.put(fieldInfo.getName(), fieldInfo); }

    public HashMap<String, FieldInfo> getFieldsInfo() {
        return fieldsInfo;
    }
}
